fn main() {
    let t = Coin::Penny;
    println!("{}", value_in_cents(t));
    let t = Coin::Nickel;
    println!("{}", value_in_cents(t));
    let t = Coin::Dime;
    println!("{}", value_in_cents(t));

    let t = Coin::Quarter(UsState::Neivada);
    println!("{}", value_in_cents(t));

    let five = Some(5);
    let six = plus_one(five);
    let non = plus_one(None);
    println!("{:?}", five);
    println!("{:?}", six);
    println!("{:?}", non);

}

#[derive(Debug)]
#[warn(dead_code)]
enum UsState {
    Neivada
}

enum Coin {
    Penny,
    Nickel,
    Dime,
    Quarter(UsState),
}

fn value_in_cents(coin: Coin) -> u32 {
    match coin {
        Coin::Penny => 1,
        Coin::Nickel => 5,
        Coin::Dime => 10,
        Coin::Quarter(state) => {
            println!("State Quarter from {:?}", state);
            25
        }
    }
}

fn plus_one(x: Option<i32>)->Option<i32>{
    match x {
        None=>None,
        Some(xe)=>Some(xe+1)
    }
}
